//
//  JCPropertyDescription.h
//  JCSDK
//
//  Created by master on 16/2/24.
//  Copyright © 2016年 AdMaster. All rights reserved.
//

#import <Foundation/Foundation.h>

@class JCSelectorParameters;
@class JCSelectorDescription;

/**
 *  捕获方式:  1.通过属性的Set/Get函数获取返回值(无参数)
 *            2. 通过方法名和参数获取返回值 (最多一个参数且都为枚举参数)
 */
@interface JCPropertyDescription : NSObject

@property (nonatomic, readonly, copy) NSString *name; // 属性名或方法名
@property (nonatomic, readonly, copy) NSString *type; // 返回值type
@property (nonatomic, readonly) BOOL readOnly;
@property (nonatomic, readonly) BOOL nofollow;
@property (nonatomic, readonly) BOOL useInstanceVariableAccess; //变量
@property (nonatomic, readonly) BOOL useKVC;   // kvc
@property (nonatomic, readonly) JCSelectorDescription *getSelectorDescription;
@property (nonatomic, readonly) JCSelectorDescription *setSelectorDescription;

- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
- (BOOL)shouldReadPropertyValueForObject:(NSObject *)object;  //是否捕获该object 的属性.
- (NSValueTransformer *)valueTransformer;

@end


@interface JCSelectorDescription : NSObject

@property (nonatomic, readonly, copy) NSString *selector;  //selector name
@property (nonatomic, readonly, copy) NSArray *parameters;  // selector type
@property (nonatomic, readonly, copy) NSString *returnType;

- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
/**
 {
    "selector": "setTitle:forState:",
        "parameters": [
        {
            "name": "title",
            "type": "NSString"
        },
        {
            "name": "state",
            "type": "UIControlState"
        }
        ]
 }
 */

@end


@interface JCSelectorParameters :NSObject

@property (nonatomic, readonly, copy) NSString *name;
@property (nonatomic, readonly, copy) NSString *type;

- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
/**
 *    {
 *       "name": "title",
 *       "type": "NSString"
 *     },
 */

@end
